﻿using System;
using System.Collections.Generic;
using System.Reflection;

namespace Web7.Ioc
{
    public interface IDependencyInjector
    {
        IDependencyInjector RegisterInstance<T>(T instance) where T : class;
        IDependencyInjector RegisterInstance<TFrom, TTo>() where TTo : class,TFrom;
        IDependencyInjector RegisterInstance(Type from, Type to);
        IDependencyInjector RegisterType<TFrom, TTo>() where TTo : class,TFrom;
        IDependencyInjector RegisterType(Type from, Type to);
        IDependencyInjector RegisterAssembly(params Assembly[] assemblies);

        T Inject<T>(T existing);
        T GetService<T>();
        IT GetService<IT, T>();
        object GetService(Type serviceType);
        IEnumerable<object> GetServices(Type serviceType);

        bool IsRegistered<T>();
        bool IsRegistered(Type type);
        bool CanResolve<T>();
        bool CanResolve(Type type);
        
    }
}
